-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#463) Ensure sensu::plugins are managed before checks #755
Conversation
@@ -666,6 +664,10 @@ | |||
$_purge_mutators = $full_purge_hash['mutators'] | |||
} | |||
|
|||
# (#463) This well-known anchor serves as a reference point so all checks are | |||
# managed after all plugins. It must always exist in the catalog. | |||
anchor { 'plugins_before_checks': } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to kill off the anchor pattern in the next big refactor after the data types. Is there another way we can do this, such as using the spaceship operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about using the spaceship operator but didn't because it's very likely some end users will have virtual or exported check resources. Collections realize resources, which would be a PITA for the end users.
This isn't the full blown anchor pattern, which is more about class containment. This is more of a lightweight, "Here's a single, well-known reference point to establish before and after."
I chatted with some people in the Puppet slack, and the best alternative to the anchor idea was https://github.com/binford2k/binford2k-manifold, but I did get some validating feedback a single anchor is reasonable in this situation and I like how simple it is to explain. All plugins are managed before the anchor, all checks are managed after the anchor, the anchor always exists in the catalog.
Without this patch plugins may be managed after the checks which use them. This patch addresses the problem by adding a well known inert resource named `Anchor[plugins_before_checks]`. The sensu::check and sensu_check_config type are managed after this anchor. The sensu::plugin defined type is managed before this anchor. The anchor approach has been implemented over collections to avoid realizing resources which the end user may be using. Resolves sensu#463
a1b12b6
to
0788152
Compare
Rebased. |
That was fast! |
Thanks! Was a good place to switch context, so good timing on the merge. |
Released in v2.27.0 |
Without this patch plugins may be managed after the checks which use them. This
patch addresses the problem by adding a well known inert resource named
Anchor[plugins_before_checks]
. The sensu::check and sensu_check_config typeare managed after this anchor. The sensu::plugin defined type is managed
before this anchor. The anchor approach has been implemented over collections
to avoid realizing resources which the end user may be using.
Resolves #463